package task10;

/**
 * @author: pyt
 * @date: 3/21/0021 19:34
 * @description：
 */
public class Bank {
    //钱
    int money;
    //年限
    int year;
    //利息
    double interest;
    //利率
    double rate;


    Bank(){

    }
    //构造方法
    Bank(int money,double rate){
        this.money=money;
        this.rate=rate;
    }
    //计算利息并返回，按整年计算
    public double compuInterest(){
        interest=year*rate*money;
        return interest;
    }

    public void setInterRate(double rate){   //设置利率
        this.rate=rate;
    }
}

